#include <iostream>
#include <string>

using namespace std;

// 基类
class person
{
private:
	/* data */
public:
	string name;
	int id;
	int height;

	person(string name, int id, int height)
	{
		this->name = name;
		this->id = id;
		this->height = height;
		cout << "父类构造函数" << endl;
	}
};

// 派生类
class man : public person
{

private:
	string name;

	// 在继承时，需要在子类的构造函数的初始化表中 显性的调用父类的构造函数
	// 来完成对父类成员的初始化
public:
	man(string name, int id, int height) : person(name, id, height)
	{
	}
	void show_date()
	{
		cout << person::name << " " << person::id << " " << this->height << endl;
	}
};
int main(int argc, char const *argv[])
{
	man m("张三", 1, 131);
	m.show_date();
	// cout << "hello world" << endl;

	return 0;
}
